<template>
	<view class="page-demo-block">
		<view class="header" :style="[{'--color':color}]">
			<text>{{title}}</text>
			<slot name="header"></slot>
		</view>
		<view class="content" :style="[contentStyle]">
			<slot></slot>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			title:String,
			color:String,
			contentStyle:Object
		}
	}
</script>

<style lang="scss" scoped>
.page-demo-block{
	background-color: #fff;
	margin-bottom: 20rpx;
	.header{
		position: relative;
		padding: 20rpx 30rpx;
		background-color: #fff;
		height: 100rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		border-bottom: 1rpx solid #e7e7e7;
		padding-left: 60rpx;
	}
	.header:before{
		content: '';
		position: absolute;
		left: 30rpx;
		height: 16rpx;
		width: 16rpx;
		background-color: var(--color);
		border-radius: 10rpx;
		overflow: hidden;
	}
	
	.content{
		padding: 20rpx;
	}
}
</style>
